Skip to content

Enable coverage when viaIR compiler flag is true#854

Merged
cgewecke merged 14 commits into
masterfrom
support-viaIR
Feb 9, 2024
Merged

Enable coverage when viaIR compiler flag is true#854
cgewecke merged 14 commits into
masterfrom
support-viaIR

Conversation

@cgewecke
Copy link
Copy Markdown
Member

@cgewecke cgewecke commented Feb 8, 2024

PUBLISHED at the viaIR tag

npm install --save-dev solidity-coverage@viaIR

#853, #848, #790, #715, #417

Uses solidity built-in ignored by the yul optimizer to preserve instrumentation when viaIR is set to true. This should address all the insane optimizer config problems.

Coverage in the plugin's own tests is missing for an edge case where the optimizer has:

  • right padded the hash to 32 bytes
  • hash has a truncated leading zero
  • hash is not duplicate (e.g it wasn't just pushed onto the stack by some other operation)

... we hit the first two conditions in the integration tests but the hash is a duplicate.

TODO

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 8, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (d3a5b37) 95.92% compared to head (62408ea) 95.77%.

Files Patch % Lines
lib/collector.js 88.88% 2 Missing ⚠️
plugins/resources/nomiclabs.utils.js 90.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #854      +/-   ##
==========================================
- Coverage   95.92%   95.77%   -0.16%     
==========================================
  Files          19       19              
  Lines         981     1017      +36     
==========================================
+ Hits          941      974      +33     
- Misses         40       43       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cgewecke
Copy link
Copy Markdown
Member Author

cgewecke commented Feb 9, 2024

E2E tested against 1inch solidity-utils and got the output below.
Compare with / identical to: https://github.com/1inch/solidity-utils/actions/runs/7756078740/job/21152695486
Screen Shot 2024-02-08 at 6 44 16 PM

NB: there was a failing test that looked at gas specific values - to be expected because the instrumentation mechanism changed and there's some consumption variance.

Screen Shot 2024-02-08 at 6 50 31 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants